/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ifrr.gepro.estoria.bean;

import br.ifrr.gepro.sprint.bean.EstDoSprintBean;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author rafael
 */
@Entity
@Table(name = "estimativas", catalog = "gepro", schema = "public")

public class EstimativasBean implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false, insertable = false)
    private Integer id;
    @Column(name = "estimativa")
    private Integer estimativa;
    @Column(name = "dataEst")
    @Temporal(TemporalType.DATE)
    private Date dataEst;
    @JoinColumn(name = "fk_estoria", referencedColumnName = "id")
    @ManyToOne
    private EstDoSprintBean fkEstoria;

    public EstimativasBean() {
    }

    public EstimativasBean(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getEstimativa() {
        return estimativa;
    }

    public void setEstimativa(Integer estimativa) {
        this.estimativa = estimativa;
    }

    public Date getData() {
        return dataEst;
    }

    public void setData(Date data) {
        this.dataEst = data;
    }

    public EstDoSprintBean getFkEstoria() {
        return fkEstoria;
    }

    public void setFkEstoria(EstDoSprintBean fkEstoria) {
        this.fkEstoria = fkEstoria;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EstimativasBean)) {
            return false;
        }
        EstimativasBean other = (EstimativasBean) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.ifrr.gepro.EstimativasBean[ id=" + id + " ]";
    }
    
}
